<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="database.DAO, golf.Guild"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
	DAO dao = DAO.getInstance();
	int charNo = Integer.parseInt(request.getParameter("selectChar"));
	int guildNo = 0;
	System.out.println("선택한 캐릭터는 : " + charNo);

	Guild.GuildMember member = dao.getGuildMember(charNo);
	if( member != null ){
		guildNo = member.getGuild_no();
		System.out.println("캐릭터의 길드가 존재합니다. 길드번호 : " + guildNo);
		session.setAttribute("guildNo", guildNo );
	}
	else{
		System.out.println("캐릭터의 길드는 존재하지 않습니다.");
	}
	
	session.setAttribute("charNo", charNo );
	System.out.println("charNo(" + charNo + ")세션 추가 완료!");
	response.sendRedirect("../jsp/selectChannel.jsp");

%>
</body>
</html>